"""
Module which is used to have a bit generator for the CRC calculation.
"""

def byteGeneratorToBit(byteGenerator):
    """Transforms a byte generator in a bit generator."""
    def ret():
        for byte in byteGenerator:
            for i in range(8,0,-1):
                yield (byte>>(i-1))&1
    return ret
